A conventional network device, such as a switch or router, includes three major components: a control processor, a line card, and a switch fabric. The conventional control processor implements various control and administrative functions, such as executing routing protocols. The line cards generally terminate physical links on the network device and implement the specific protocol processing functions that define a particular network. On input, a processing function may include determining a next node in the network to which the packet should be sent. On output, a processing function may include scheduling the packet for transmission on an outgoing link, for example, using a queuing subsystem.
The switch fabric is responsible for transferring packets from the nodes (e.g., line cards) from which the packet was received to the nodes (e.g., line cards) for the outgoing link connected to the next node in the network. For example, after a forwarding decision is made, a packet is sent to the switch fabric, which then sends the packet to a line card for the outgoing link. The packet is transmitted through the outgoing link to the next node.
The switch fabric typically includes fabric ingress ports, fabric egress ports, data buffers, and shared memory. Credit-based flow control may be used to control access to a resource, such as a buffer in the switch fabric. An individual credit represents a resource. The credits are allocated to a sending party (“producer” or “sender”) for sending data to a receiving party (“consumer” or “receiver”). In other words, credit-based flow control may be used to prevent buffer overflow. As the producer sends data to the consumer, it uses a number of credits corresponding to the quantity of data being sent. When the credits allocated to the producer are depleted, the producer is not able to send more data. As the resource is freed on the consumer (i.e., data stored in the buffer is removed), credits are returned to the producer. As credits are replenished, the producer may send more data in proportion to the number of replenished credits.